home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Frameworks / Grant's CGI Framework 1.0b14 / MyConfiguration.h < prev    next >
C/C++ Source or Header  |  1996-04-12  |  9KB  |  259 lines

  1. #pragma once
  2. /*****
  3.  *
  4.  *    MyConfiguration.h
  5.  *
  6.  *    You will want to modify the constants in this header file to
  7.  *    set the code to compile with the particular options you want.
  8.  *    Use 1 (one) to turn an option on, 0 (zero) to turn it off.
  9.  *
  10.  *    I've marked recent additions to this file with
  11.  *        •new•
  12.  *    in a comment.
  13.  *
  14.  *    This is a support file for "Grant's CGI Framework".
  15.  *    Please see the license agreement that accompanies the distribution package
  16.  *    for licensing details.
  17.  *
  18.  *    Copyright ©1995,1996 by Grant Neufeld
  19.  *    grant@acm.com
  20.  *    http://arpp.carleton.ca/grant/
  21.  *
  22.  *****/
  23.  
  24. #include "constants.h"
  25.  
  26.  
  27. /***  CONSTANT DECLARATIONS  ***/
  28.  
  29. /**  THREADS  **/
  30.  
  31. /* if off, the thread manager must be present for the app to run */
  32. #define kCompileWithThreadsOptional        1
  33. /* if on, all Apple Events (including the CGI sdoc event) will be
  34.     spawned off as separate threads. If off, you are on your own for
  35.     threading the CGI events. */
  36. #define kCompileWithThreadedAppleEvents    1
  37. /* number of threads to preallocate; used by startupThreads.
  38.     If you've turned off kCompileWithThreadedAppleEvents and make no
  39.     calls to the MyNewThreadFromPool function, you'll probably want to
  40.     set this to zero */
  41. #define kStartupThreadsPreallocate        5
  42.  
  43.  
  44. /**  QUITTING  **/
  45.  
  46. /* if on, app will try to quit after a set time of idling */
  47. #define kCompileWithQuitOnLongIdle        1
  48. /* the amount of idle time, in ticks (60ths of a second), before
  49.     the application self quits. 60*60 is one minute in ticks. */
  50. #define kIdleTimeToQuit                    (5 * kOneMinuteInTicks)
  51. /* if on, app will not quit on idle if it was opened with no special
  52.     event - starts off by receiving an OpenApplication AppleEvent */
  53. #define kCompileWithIdleQuitOnOpenApp    1
  54. /* if memory gets 'precariously' low, the application will be set to quit.
  55.     This _may_ (note: untested) speed up the application. Needs profiling */
  56. #define kCompileWithQuitOnLowMemory        1
  57.  
  58.  
  59. /**  Modules  (CGI/ListSTAR)  **/
  60.  
  61. /* the following determine which modules are compiled */
  62. /* CGI */
  63. #define kCompileWithCGICode                1
  64. /* ListSTAR */
  65. #define kCompileWithListSTARCode        0
  66.  
  67.  
  68. /**  CGI Support  **/
  69.  
  70. /* Send-partial event support (CGIAESendPartial).
  71.     Also includes the connection field of the CGIRecord. */
  72. #define kCompileWithCGISendPartial        1
  73. /* Form handling code (all the CGIFormFields... functions).
  74.     If you turn this off, the formFields and totalFields will not
  75.     be available in the CGIHandles. */
  76. #define kCompileWithCGIFormHandling        1
  77. /* automatically format form data before calling MyCGIProcess. */
  78. #define kCompileWithCGIFormAutoProcess    1
  79. /* automatically decode parameters (convert %xx values, and special chars)
  80.     Parameters affected: path_args, http_search_args */
  81. #define kCompileWithCGIAutoDecode        1
  82. /* Used for backwards compatibility - if you have old code that
  83.     uses the responseData field of the CGIRecord (CGIHdl) structure as
  84.     a 'char *', turn off this flag (set to zero). Otherwise, just leave
  85.     it on (set to 1). If you update your old code to use responseData as
  86.     a Handle, then set this on. */
  87. #define kCompileWithCGIResponseDataAsHandle    1
  88.  
  89. /* support use as a user defined action */
  90. #define kCompileWithCGIActionSupport    1
  91.  
  92. /**  CGI Parameters  **/
  93.  
  94. /* If you want to link your own data into the CGIHdl, use the
  95.     'refCon' field (a long value) to store custom data. */
  96. #define kCompileWithCGIRefCon            1
  97.  
  98. /* '----' path_args            */
  99. #define kCompileWithCGIpath_args        1
  100. /* 'kfor' http_search_args    */
  101. #define kCompileWithCGIhttp_search_args    1
  102. /* 'user' username            */
  103. #define kCompileWithCGIusername            1
  104. /* 'pass' password            */
  105. #define kCompileWithCGIpassword            1
  106. /* 'frmu' from_user            */
  107. #define kCompileWithCGIfrom_user        1
  108. /* 'addr' client_address    */
  109. #define kCompileWithCGIclient_address    1
  110. /* 'post' post_args            */
  111. #define kCompileWithCGIpost_args        1
  112. /* 'meth' method            */
  113. #define kCompileWithCGImethod            1
  114. /* 'svnm' server_name        */
  115. #define kCompileWithCGIserver_name        1
  116. /* 'svpt' server_port        */
  117. #define kCompileWithCGIserver_port        1
  118. /* 'scnm' script_name        */
  119. #define kCompileWithCGIscript_name        1
  120. /* 'ctyp' content_type        */
  121. #define kCompileWithCGIcontent_type        1
  122. /* 'refr' referer            */
  123. #define kCompileWithCGIreferer            1
  124. /* 'Agnt' user_agent        */
  125. #define kCompileWithCGIuser_agent        1
  126. /* 'Kcip' client_ip            */
  127. #define kCompileWithCGIclient_ip        1
  128. /* 'Kfrq' full_request        */
  129. #define kCompileWithCGIfull_request        1
  130. //• this isn't actually a parameter of the CGI event
  131. ///* 'Pvrs' version            */
  132. //#define kCompileWithCGIversion    0
  133.  
  134.  
  135. /**  INTERFACE  **/
  136.  
  137. /* setting this to off will create a background only application with
  138.     no user interface. The application won't show up in the
  139.     application menu. */
  140. #define kCompileWithForeground            1
  141. #if kCompileWithForeground /* only allow the options below if foreground */
  142.  
  143. /* setting this on will allow user interface elements such as error 
  144.     dialogs to pop up. Turn it off if you want the application to be able
  145.     to run without requiring any user interaction. User interface elements
  146.     such as menus will still be available (providing CompileWithForeground
  147.     is on). */
  148. #define    kCompileWithFullUserInterface    0    
  149. /* display the splash screen on startup */
  150. #define kCompileWithSplashScreen        0
  151. /* application uses modeless dialogs - required if you are supporting
  152.     url clicking in your about box */
  153. #define kCompileWithModelessDialogs        1
  154. /* application uses custom windows */
  155. #define kCompileWithApplicationWindows    0
  156. /* application handles custom keyboard entry */
  157. #define kCompileWithKeyboardEvents        0
  158. /* support drag and drop manager */
  159. #define kCompileWithDragNDrop            0
  160.  
  161. /* •new• support url clicking for download in the about box */
  162. #define kCompileWithAboutURL            1
  163.  
  164. #endif /* kCompileWithForeground */
  165.  
  166.  
  167. /***  PROCESS / APPLICATION  ***/
  168.  
  169. /* If this is defined, the application will have a global 'gProcessFSSpec'
  170.     that is automatically, during startup, set to be the application's
  171.     file spec. */
  172. #define kCompileWithProcessFileSpec        1
  173. /* default setting for the sleep time passed to functions such as
  174.     WaitNextEvent */
  175. #define kSleepTicks                        (2 * kOneSecondInTicks)
  176. /* default setting for the sleep time passed to functions such as
  177.     WaitNextEvent when the application is busy with tasks */
  178. #define kSleepTicksWhenBusy                5
  179. /* •new• set this on if you want to support the CustomDeferredTask
  180.     function which allows you to have tasks processed when the
  181.     application is less busy */
  182. #define kCompileWithDeferredTask        1
  183.  
  184.  
  185. /***  MEMORY CONFIGURATION  ***/
  186.  
  187. /* You will need to estimate your memory requirements here */
  188.  
  189. /* 'comfort' zone of free memory. This must be big enough to allow
  190.     any essential functions to be called.
  191.     This is used as an 'emergency' reserve of memory to be
  192.     deallocated if seriously needed.
  193.     Named kMemCushion in IM-Memory: 1-43, 1-36 */
  194. #define kMemCushionSize            8192L /* 8k */
  195. /* for pre-allocation of master pointers.
  196.     Used in initAppMemory "Main.c"
  197.     IM-Memory: 1-42 */
  198. #define    kMoreMasterCalls        4
  199. /* minimum free space needed (in bytes) for application to be able to run.
  200.     Should probably be a multiple of 1024.
  201.     Should be bigger than kMemChusionSize */
  202. #define kMinSegSize                32768L /* 32k */
  203.  
  204. /** •new• COMPILING  **/
  205.  
  206. /* •new• if you don't want to support the old function names that began
  207.     with 'My', then turn this option on. The names were changed because
  208.     people were wanting to keep the 'My' namespace for their custom code */
  209. #define kCompileWithout_MY_Names        0
  210.  
  211.  
  212. /**  PROFILER support  **/
  213.  
  214. /* max 21 chars in length.
  215.     End result will be something like "\p<name>-68K.prof" or "...-PPC.prof" */
  216. #define kProfileNameStr            "cgi"
  217.  
  218.  
  219. /** •new• LOGGING */
  220.  
  221. #define kCompileWithLogSupport            1
  222.  
  223.  
  224. /**  DEBUGGING Support  **/
  225.  
  226. #if kCompileWithLogSupport /* logging required for these options */
  227.     /* •new• cgi will log a number of actions to the log file */
  228.     #define kCompileWithDebugLogging    1
  229.     /* •new• cgi will log error messages to the log file */
  230.     #define kCompileWithErrorLogging    1
  231. #else /* don't change these two lines */
  232.     #define kCompileWithDebugLogging 0 /* always off if logging off */
  233.     #define kCompileWithErrorLogging 0 /* always off if logging off */
  234. #endif
  235. /* if you are debugging your code, you should set assertions on (1).
  236.     If you are shipping your application, you should turn assertions off (0). */
  237. #define kCompileWithAssertions            1
  238.  
  239.  
  240. /**  MISCELLANEOUS  **/
  241.  
  242. /* •new• If you are using Pascal for the custom functions (mixing C
  243.     and Pascal source files in a project) the C functions need to be
  244.     defined to support Pascal calling conventions. Set this option on
  245.     for Pascal calling conventions to be used (allowing you to call some
  246.     of the functions in the C source files from Pascal files. */
  247. #define kCompileWithPascalSupport        0
  248.  
  249. /* •new• set this to be your application creator type */
  250. #define kMyCreatorType                    'CGI?'
  251.  
  252.  
  253.  
  254. #if (kStartupThreadsPreallocate < 1) && kCompileWithDeferredTask
  255. #error /* you must have at least one preallocated thread if you are going to use deferred tasks */
  256. #endif
  257.  
  258. /***  EOF  ***/
  259.